﻿@{
    ViewBag.Title = "部门档案权限";
    Layout = "~/Views/Shared/_LayoutForBUI.cshtml";
}
<body class="navbar-bottom">
    <div class="page-container">
        <!-- Page content -->
        <div class="page-content">
            <div class="sidebar sidebar-secondary sidebar-default" style=" width:150px">
                <div class="sidebar-content" style="overflow:auto;">
                     <div class="sidebar-category" >
                                    <div class="category-title">
                                        <span>部门分类</span>
                                        <ul class="icons-list">
                                            <li><a href="javascript:void(0)" data-action="collapse"></a></li>
                                        </ul>
                                    </div>
                                    <div class="category-content no-padding">
                                        @{
                                        if (ViewBag.Tree != null)
                                        {
                                            var trees = ViewBag.Tree as List<SGArchiveSystem7x.Models.CDepartmentTreeModel>;
                                            foreach (var m in trees)
                                            {
                                        <ul class="navigation navigation-alt navigation-accordion">
                                            @{
                                                if (m.childDepartment.Count > 0)
                                                {
                                                    foreach (var cm in m.childDepartment)
                                                    {
                                                        <li><a href="javascript:void(0)" onclick="ToDep(@cm.Dep_ID, '@cm.Dep_Name')"><i class="icon-home4"></i><span>@cm.Dep_Name</span></a></li>
                                                    }
                                                }
                                                else
                                                {
                                                    <li><a href="javascript:void(0)" onclick="ToDep(@m.Deparetment.Dep_ID, '@m.Deparetment.Dep_Name')"><i class="icon-home4"></i><span>@m.Deparetment.Dep_Name</span></a></li>
                                                }
                                            }
                                        </ul>
                                                }
                                            }
                                        }
                                    </div>
                                </div>
                </div>
            </div>
            <div class="content-wrapper">
                <div style="margin-top:0px;margin-left:5px;margin-right:5px">
                    <iframe id="ArchiveAuthority_DepartmentArchiveAuthority_frmMain" src="" frameborder="0" scrolling="auto" width="100%"></iframe>
                </div>
            </div>
        </div>
    </div>
    <!-- Page container -->
    
    <!-- /page container -->
    <script>
        var height = document.documentElement.clientHeight; //window.screen.height-280;
        var width = document.documentElement.clientWidth; //window.screen.width;
        var leftW = 300;
        if (width > 1200) {
            leftW = 500;
        } else if (width > 1000) {
            leftW = 350;
        } else {
            leftW = 100;
        }
        $('#ArchiveAuthority_DepartmentArchiveAuthority_frmMain').height(height);

        function ToDep(id, title) {
            var frm = document.getElementById('ArchiveAuthority_DepartmentArchiveAuthority_frmMain');
            frm.src = '/ArchiveAuthority/DepartmentArchiveList?DepartmentId=' + id + '&title=' + title;
        }
    </script>
</body>
